package org.clockworkmages.games.anno1186.situations.inventory.options;

import org.clockworkmages.games.anno1186.GameBeansContext;
import org.clockworkmages.games.anno1186.GameStateService;
import org.clockworkmages.games.anno1186.model.item.Item;
import org.clockworkmages.games.anno1186.model.option.Option;
import org.clockworkmages.games.anno1186.situations.inventory.InventoryItemSituation;

public class InventoryItemOption
		extends Option {

	private Item item;

	public InventoryItemOption(Item item) {
		this.item = item;
		this.setLabel(item.getName());
	}

	@Override
	public void select() {

		InventoryItemSituation situation = new InventoryItemSituation(item);
		GameStateService gameStateService = GameBeansContext
				.getBean(GameStateService.class);
		gameStateService.addSituation(situation, true);
		super.select();
	}
}
